#lang racket

(define (square x) (* x x))

(define (double x) (+ x x))

(define (halve x) (floor (/ x 2)))

(define (fast-mult b n)
  (cond ((= n 0) 0)
        ((even? n) (double (fast-mult b (halve n))))
        (else (+ b (fast-mult b (- n 1))))))

(fast-mult 3 7)